package com.bojx.report.util;

import com.bojx.report.pojo.Result;
import com.bojx.report.pojo.ResultEnum;

public class ResultUtil {

	public static <T> Result<T> success(T object){
		Result<T> result=new Result<T>();
		result.setCode(ResultEnum.SUCCESS.getCode());
		result.setMessage(ResultEnum.SUCCESS.getMessage());
		result.setData(object);
		return result;
	}
	
	public static Result<?> success(){
		return success(null);
	}
	public static Result<?> error(String code,String message){
		Result<?> result=new Result<Object>();
		result.setCode(code);
		result.setMessage(message);
		return result;
	}

}
